package sdk.webview.fmc.com.fmcsdk.check.adapter;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import sdk.webview.fmc.com.fmcsdk.R;
import sdk.webview.fmc.com.fmcsdk.bean.ApprovalAcceptanceHistoryBean;
import sdk.webview.fmc.com.fmcsdk.util.KLog;


public class ApprovalAcceptanceHistoryAdapter extends BaseQuickAdapter<ApprovalAcceptanceHistoryBean, BaseViewHolder> {
    public ApprovalAcceptanceHistoryAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder holder, ApprovalAcceptanceHistoryBean item) {
        KLog.e(holder.getAdapterPosition());
        if (holder.getAdapterPosition() == getData().size() - 1) {
            holder.getView(R.id.iv_line).setVisibility(View.GONE);
            holder.getView(R.id.iv_line_last).setVisibility(View.VISIBLE);
        } else {
            holder.getView(R.id.iv_line).setVisibility(View.VISIBLE);
            holder.getView(R.id.iv_line_last).setVisibility(View.GONE);
        }
        holder.setText(R.id.tv_time, item.getTime());
        holder.setText(R.id.tv_result, item.getName());
        holder.setText(R.id.tv_status, item.getStatus());
    }
}
